CREATE TABLE [dbo].[TDBANC_DIST]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_BANC] [dbo].[TD_VC_003] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[NU_CNTA_BANC] [dbo].[TD_VC_020] NOT NULL,
[AA_BNCO] [dbo].[TD_VC_004] NOT NULL,
[MM_BNCO] [dbo].[TD_VC_002] NOT NULL,
[TI_MOVI_BANC] [dbo].[TD_VC_001] NOT NULL,
[NU_COMP_BANC] [dbo].[TD_VC_008] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDBANC_DI__NU_SE__035179CE] DEFAULT ((0)),
[CO_CNTA_EMPR] [dbo].[TD_VC_020] NOT NULL,
[TI_MOVI] [dbo].[TD_VC_001] NOT NULL,
[CO_TIPO_AUXI] [dbo].[TD_VC_001] NULL,
[CO_AUXI_EMPR] [dbo].[TD_VC_020] NULL,
[CO_ORDE_SERV] [dbo].[TD_VC_020] NULL,
[ST_DIST] [dbo].[TD_VC_001] NOT NULL,
[PO_DIST] [dbo].[TD_NU_009_004] NOT NULL CONSTRAINT [DF__TDBANC_DI__PO_DI__04459E07] DEFAULT ((0)),
[IM_DIST] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDBANC_DI__IM_DI__0539C240] DEFAULT ((0)),
[TI_DOCU] [dbo].[TD_VC_003] NULL,
[DE_OBSE] [dbo].[TD_VC_100] NULL,
[FE_DOCU] [dbo].[TD_DT_001] NULL,
[NU_DOCU] [dbo].[TD_VC_020] NULL,
[NU_IMPO] [dbo].[TD_VC_020] NULL,
[NU_EXPO] [dbo].[TD_VC_020] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDBANC_DI__CO_US__062DE679] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDBANC_DI__FE_US__07220AB2] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDBANC_DI__CO_US__08162EEB] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDBANC_DI__FE_US__090A5324] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDBANC_DIST] ADD CONSTRAINT [PK__TDBANC_D__FF89FA26764262CA] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_BANC], [CO_UNID_CONC], [NU_CNTA_BANC], [AA_BNCO], [MM_BNCO], [TI_MOVI_BANC], [NU_COMP_BANC], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDBANC_DIST] ADD CONSTRAINT [FK__TDBANC_DIST__29ACF837] FOREIGN KEY ([CO_EMPR], [CO_BANC], [CO_UNID_CONC], [NU_CNTA_BANC], [AA_BNCO], [MM_BNCO], [TI_MOVI_BANC], [NU_COMP_BANC]) REFERENCES [dbo].[TCMOVI_BANC] ([CO_EMPR], [CO_BANC], [CO_UNID_CONC], [NU_CNTA_BANC], [AA_BNCO], [MM_BNCO], [TI_MOVI_BANC], [NU_COMP_BANC])
GO
